import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { createAppRouter } from './router/index.js'

const app = createApp(App)
app.use(ElementPlus)

// 异步创建并挂载路由
createAppRouter().then((router) => {
  app.use(router)
  app.mount('#app')
}).catch((err) => {
  console.error('初始化路由失败：', err)
  app.mount('#app')
})
